<template>
  <div class="home-foot">
    <a-button-group>
      <a-button
        :type="button.type ? button.type : ''"
        v-for="(button, buttonIndex) in footGroup"
        :class="button.class ? button.class : ''"
        @click="groupEvent(button['_'])"
        :key="buttonIndex"
      >
        {{ button.title }}
      </a-button>
    </a-button-group>
  </div>
</template>

<script lang="ts">
/*eslint-disable*/
import { Component, Vue, Prop } from "vue-property-decorator";

@Component({
  name: "HomeFoot",
})
export default class HomeFoot extends Vue {
  @Prop({
    default: () => {
      return [];
    },
  })
  footGroup;

  groupEvent(_) {
    if (!this.parent[_]) return false;
    this.parent[_]();
  }

  get parent() {
    return this.$parent.$parent.$parent;
  }
}
</script>

<style scoped lang="scss">
.home-foot {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  overflow: hidden;
  .ant-btn-group {
    width: 100%;
    display: flex;

    .ant-btn {
      flex: 1;
      border-radius: 0;
    }

    .turnDown {
      background: #e6a23c;
      color: white;
      border-color: #e6a23c;
      text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.12);
      box-shadow: 0 2px 0 rgba(0, 0, 0, 0.045);
    }

    .through {
      background: #67c23a;
      color: white;
      border-color: #67c23a;
      text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.12);
      box-shadow: 0 2px 0 rgba(0, 0, 0, 0.045);
    }
  }
}
</style>
